package entity;

import java.io.Serializable;

public class User implements Serializable {
    protected String username;
    protected String password;
    protected String role; // 管理员/经理/前台
    protected boolean isFirstLogin;

    public User(String username, String password, String role) {
        this.username = username;
        this.password = password;
        this.role = role;
        this.isFirstLogin = true; // 初始为首次登录
    }

    // 查看个人信息
    public void showUserInfo() {
        System.out.println("\n===== 个人信息 =====");
        System.out.println("用户名：" + username);
        System.out.println("角色：" + role);
    }

    // getter和setter
    public String getUsername() { return username; }
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }
    public String getRole() { return role; }
    public boolean isFirstLogin() { return isFirstLogin; }
    public void setFirstLogin(boolean firstLogin) { isFirstLogin = firstLogin; }
}